package org.elephas.webapp.frontend.component.links;

import org.apache.wicket.markup.html.link.Link;
import org.apache.wicket.markup.html.panel.Panel;
import org.elephas.webapp.application.ElephasSession;

public class LogoutLinkPanel extends Panel {
	private static final long serialVersionUID = 1L;

	public LogoutLinkPanel(String id) {
		super(id);
		add(new Link("logout") {
			private static final long serialVersionUID = 1L;

			@Override
			public void onClick() {
				ElephasSession.get().signOut();
			}
		});
	}
	
	@Override
	public boolean isVisible() {
		return ElephasSession.get().isSignedIn();
	}
}
